﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CarShop
{
    public class Van : Vehicle, IDescriptive
    {
        //fields
        private Engine vanEngine;
        private Transmission vanTransmission;
        private int maxWeight;
        private DrivingWheel drive;
        private List<string> vanDescription = new List<string>();

        //constructor
        public Van(string brand, string model, string color, int year, int speed, int price, Engine vanEngine, Transmission vanTransmission, int maxWeight, List<string> vanDescription, DrivingWheel drive)
            : base(brand, model, color, year, speed, price)
        {
            this.vanEngine = vanEngine;
            this.vanTransmission = vanTransmission;
            this.maxWeight = maxWeight;
            this.vanDescription = vanDescription;
            this.drive = drive;
        }

        //properties
        public Transmission VanTransmission
        {
            get
            {
                return this.vanTransmission;
            }
            set
            {
                this.vanTransmission = value;
            }
        }

        public Engine VanEngine
        {
            get
            {
                return this.vanEngine;
            }
            set
            {
                this.vanEngine = value;
            }
        }

        private int MaxWeight
        {
            get
            {
                return this.maxWeight;
            }
            set
            {
                this.maxWeight = value;
            }
        }

        private DrivingWheel Drive
        {
            get
            {
                return this.drive;
            }
            set
            {
                this.drive = value;
            }
        }

        public List<string> Description
        {
            get { return vanDescription; }
            set
            {
                this.vanDescription = value;
            }
        }

        //methods
        public void AddComment(string extra)
        {
            this.vanDescription.Add(extra);
        }

        public override string AdditionalInfo()
        {
            StringBuilder someVan = new StringBuilder();
            someVan.AppendLine("Maximum van weight : " + this.MaxWeight.ToString());
            someVan.AppendLine("Transmission: " + this.VanTransmission.ToString());
            someVan.AppendLine("Drive: " + this.Drive.ToString());
            someVan.AppendLine(this.VanEngine.ToString());
            someVan.AppendLine("Extras :");
            foreach (var extra in vanDescription)
            {
                someVan.Append(extra.ToString() + " ");
            }
            return someVan.ToString();
        }

    }
}
